/**
 * 运动员公示页面 - 搜索表单配置
 */

import type { FormItemRows } from '@meetjs/element-plus-kit'
import { useDict } from '@/composables/useDict'
import { SYSTEM_DICT, ATHLETE_DICT } from '@/constants/dictKeys'

// 使用 useDict hook 获取字典和组织级联数据
const { dicts, registerOrgOptions } = useDict([
	SYSTEM_DICT.SEX, // 性别
	ATHLETE_DICT.PROJECT // 注册项目
])

/**
 * 搜索表单配置
 */
export const searchFormConfig: FormItemRows[] = [
	{
		type: 'input',
		label: '姓名',
		prop: 'athleteName',
		col: 4,
		attrs: {
			placeholder: '请输入',
			clearable: true
		}
	},
	{
		type: 'select',
		label: '性别',
		prop: 'sex',
		col: 4,
		options: dicts[SYSTEM_DICT.SEX] as unknown as any
	},
	{
		type: 'date-picker',
		label: '公示月份',
		col: 4,
		prop: 'publicityTime',
		attrs: {
			type: 'month',
			placeholder: '请选择月份',
			format: 'YYYYMM',
			valueFormat: 'YYYYMM',
			clearable: true
		}
	},
	{
		type: 'select',
		label: '变更类型',
		prop: 'changeType',
		col: 6,
		options: [
			{
				label: '单位变更',
				value: 1
			},
			{
				label: '项目变更',
				value: 2
			}
		]
	}
]
